//
//  CustomAnnotationView.m
//  Manage
//
//  Created by 杨康 on 2017/11/14.
//  Copyright © 2017年 杨康. All rights reserved.
//

#import "CustomAnnotationView.h"

@implementation CustomAnnotationView
#pragma mark - Life Cycle

- (id)initWithAnnotation:(id<MAAnnotation>)annotation reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithAnnotation:annotation reuseIdentifier:reuseIdentifier];
    
    if (self)
    {
        
        self.bounds = CGRectMake(0.f, 0.f, 65, 65);
        
        self.backgroundColor = [UIColor clearColor];
        
        
        
        
        
        self.nameLab=[[UILabel alloc]init];
        self.nameLab.backgroundColor=[UIColor whiteColor];
        self.nameLab.font=[UIFont systemFontOfSize:12];
        self.nameLab.textColor=[UIColor color6];
        self.nameLab.layer.masksToBounds=YES;
        self.nameLab.layer.cornerRadius=5;
        self.nameLab.layer.borderWidth=0.5;
        self.nameLab.layer.borderColor=[UIColor color9].CGColor;
        [self addSubview:self.nameLab];
        [self.nameLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(0);
            make.centerX.mas_equalTo(self);
            make.height.mas_equalTo(18);
            
        }];
        
        UIImageView *transView=[[UIImageView alloc]init];
        transView.image=[UIImage imageNamed:@"下三角"];
        [self addSubview:transView];
        [transView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.nameLab.mas_bottom).mas_offset(-1);
            make.centerX.mas_equalTo(self);
        }];
        
        
        self.btn3=[[UIButton alloc]init];
        [self addSubview:self.btn3];
        [self.btn3 mas_makeConstraints:^(MASConstraintMaker *make) {
    make.top.mas_equalTo(self.nameLab.mas_bottom).mas_offset(10);
            make.centerX.mas_equalTo(self);
        }];
        
        
        
        
    }
    
    return self;
}


@end
